package com.example.shoppingcenter.POJO;

import com.example.shoppingcenter.Ai.ClipDrop.ImageVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Base64;

@AllArgsConstructor
@NoArgsConstructor
@Data  //@Getter + @Setter + @EqualsAndHashCode + @ToString
@Component
public class Image {
    private int id;
    private int userId;
    private byte[] image;
    public ImageVO convert(){
        String base64 = Base64.getEncoder().encodeToString(image);
        return new ImageVO(id, base64);
    }
}
